import server from '@/plugin/axios/request_axios.js'

/**
 * 添加一个规则组
 */
export function addRuleGroupItem(data) {
  return server('POST', '/log/realtime/group/insert', data)
}

/**
 * 修改一个规则组
 */
export function updateRuleGroupItem(data) {
  return server('PUT', '/log/realtime/group/update', data)
}

/**
 * 删除一个规则组
 */
export function deleteRuleGroupItem(groupId) {
  return server('DELETE', '/log/realtime/group/delete', { id: groupId })
}

/**
 * 多条查询规则组
 */
export function selectRuleGroup() {
  return server('GET', '/log/realtime/group/select')
}

/**
 * 添加一条规则数据
 */
export function addRuleItem(data) {
  return server('POST', '/log/realtime/analysis/insert', data)
}

/**
 * 修改一条规则数据
 */
export function updateRuleItem(data) {
  return server('PUT', '/log/realtime/analysis/update', data)
}

/**
 * 删除一条规则数据
 */
export function deleteRuleItem(id) {
  return server('DELETE', '/log/realtime/analysis/delete', { id: id })
}

/**
 * 查询规则数据
 */
export function selectRuleData(data) {
  return server('POST', '/log/realtime/analysis/select', data)
}

/**
 * 获取逻辑运算数据
 */
export function selectLogicData(data) {
  return server('GET', '/log/realtime/analysis/luoji', data)
}

/**
 * 获取字段条件中中间下拉框的数据
 */
export function getFieldData(data) {
  return server('GET', '/log/realtime/analysis/field', data)
}
